package cn.itsource.org.domain;

import cn.itsource.basic.domain.BaseDomain;
import cn.itsource.basic.domain.CreatePassword;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;

@Table(name = "t_employee") //tkmybatis实体类指向的数据库表名
@Data  //生成get set toString
@ApiModel(value = "员工对象", description = "员工对象实体类")
public class Employee extends BaseDomain implements CreatePassword {

    /**
     * 规则解耦
     */
    public interface LoginEmployee{};

    @NotBlank(message = "用户名不能为空",groups = {LoginEmployee.class})
    private String username;
    private String email;
    //盐值
    private String salt;
    private String phone;
    @NotBlank(message = "密码不能为空",groups = {LoginEmployee.class})
    private String password;
    /**
     * 不参与数据库的crud
     */
    @Transient
    private String comfirmPassword;
    private Integer age;
    private Integer state;
    @Column(name = "department_id")
    private Long departmentId;
    @Column(name = "logininfo_id")
    private Long logininfoId;
    @Column(name = "shop_id")
    private Long shopId;
    @Column(name = "parent_id")
    private Long parentId;
    @Column(name = "manager_id")
    private Long managerId;

}
